﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;
using DevExpress.XtraEditors;
using ECRMS.WinForm.BaseClass;
using DevExpress.XtraBars;

namespace ECRMS.WinForm.ModuleEdits
{
    public partial class BaseEdit : DevExpress.XtraEditors.XtraForm
    {
        public Core core = Core.getInstance();
        public OperationEnum Op = OperationEnum.Null;

        public BaseEdit()
        {
            InitializeComponent();
        }

        protected bool MenuBarVisiable
        {
            get { return bar.Visible; }
            set { bar.Visible = value; }
        }
        //新增
        protected bool NewBarButtonVisiable
        {
            get { return newBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { newBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //保存
        protected bool SaveBarButtonVisiable
        {
            get { return saveBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { saveBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //删除
        protected bool DelBarButtonVisiable
        {
            get { return delBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { delBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //刷新
        protected bool RefreshBarButtonVisiable
        {
            get { return refreshbarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { refreshbarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //重置
        protected bool ResetBarButtonVisiable
        {
            get { return resetBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { resetBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //修改
        protected bool EditBarButtonVisiable
        {
            get { return editBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { editBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //其他
        protected bool OtherBarButtonVisiable
        {
            get { return otherBarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { otherBarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }
        //其他1
        protected bool Other1ButtonVisiable
        {
            get { return other1BarButton.Visibility == BarItemVisibility.Always ? true : false; }
            set { other1BarButton.Visibility = (value == true ? BarItemVisibility.Always : BarItemVisibility.Never); }
        }

        //新增
        protected string NewBarButtonContent
        {
            get { return newBarButton.Caption; }
            set { newBarButton.Caption = value; }
        }
        //保存
        protected string SaveBarButtonContent
        {
            get { return saveBarButton.Caption; }
            set { saveBarButton.Caption = value; }
        }
        //删除
        protected string DelBarButtonContent
        {
            get { return delBarButton.Caption; }
            set { delBarButton.Caption = value; }
        }
        //刷新
        protected string RefreshBarButtonContent
        {
            get { return refreshbarButton.Caption; }
            set { refreshbarButton.Caption = value; }
        }
        //重置
        protected string ResetBarButtonContent
        {
            get { return resetBarButton.Caption; }
            set { resetBarButton.Caption = value; }
        }
        //修改
        protected string EditBarButtonContent
        {
            get { return editBarButton.Caption; }
            set { editBarButton.Caption = value; }
        }

        //其他一
        protected string OtherBarButtonContent
        {
            get { return otherBarButton.Caption; }
            set { otherBarButton.Caption = value; }
        }
        //其他二
        protected string Other1BarButtonContent
        {
            get { return other1BarButton.Caption; }
            set { other1BarButton.Caption = value; }
        }


        #region barButton 事件注册
        public virtual void newBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }
        public virtual void saveBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void editBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }
        public virtual void delBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }
        public virtual void refreshBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }
        public virtual void resetBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void otherBarButtonClick(object sender, ItemClickEventArgs e)
        {

        }

        public virtual void other1BarButtonClick(object sender, ItemClickEventArgs e)
        {

        }

        #endregion

    }
}